import { Connection } from 'mongoose';
import { UserModel } from './schemas/user.schema';
import { PhotoModel } from './schemas/photo.schema';

/**mongo数据库表提供者 */
export const MongoProviders = [
	{
		provide: 'USER_MODEL',
		useFactory: (connection: Connection) => connection.model('User',UserModel),
		inject: ['DATABASE_CONNECTION'],
	},
	{
		provide: 'PHOTO_MODEL',
		useFactory: (connection: Connection) => connection.model('Photo',PhotoModel),
		inject: ['DATABASE_CONNECTION'],
	},
];
